package com.qf.service.impl;

import com.qf.dao.CatalogDao;
import com.qf.pojo.Catalog;
import com.qf.service.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CatalogServiceImpl implements CatalogService {
    @Autowired(required = false)
    CatalogDao catalogDao;
    @Override
    public List<Catalog> findAll() {
        return catalogDao.findAll();
    }

    @Override
    public List<Catalog> findByName(String name) {
        return catalogDao.findByName(name);
    }

    @Override
    public List<Catalog> findByParent(Integer parent) {
        return catalogDao.findByParent(parent);
    }

    @Override
    public List<Catalog> findByLevel(Integer level) {
        return catalogDao.findByLevel(level);
    }

    @Override
    public int add(Catalog catalog) {
        return catalogDao.add(catalog);
    }

    @Override
    public int update(Catalog catalog) {
        return catalogDao.update(catalog);
    }

    @Override
    public int delete(Integer id) {
        return catalogDao.delete(id);
    }
}
